<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>体检套餐列表</title>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../static/css/style.css" th:href="@{/css/style.css}"/>
</head>
<body>
<div th:replace="~{common/layout :: header}"></div>
<div th:replace="~{common/layout :: sidebar}"></div>
<div class="container mt-5">
    <h1 class="mb-4">体检套餐列表</h1>
    <a href="/setmeals/add" class="btn btn-primary">添加新套餐</a>
    <hr>
    <table class="table table-striped">
        <thead>
        <tr>
            <th>套餐编号</th>
            <th>套餐名称</th>
            <th>套餐类型</th>
            <th>套餐价格</th>
            <th>体检项</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="setmeal : ${setmeals}">
            <td th:text="${setmeal.smId}"></td>
            <td th:text="${setmeal.name}"></td>
            <td th:text="${setmeal.type == 1 ? '男士套餐' : '女士套餐'}"></td>
            <td th:text="${setmeal.price}"></td>
            <td>
                <ul>
                    <li th:each="item : ${setmeal.checkitemNames}" th:text="${item}"></li>
                </ul>
            </td>
            <td>
                <a th:href="@{/setmeals/view/{id}(id=${setmeal.smId})}" class="btn btn-info btn-sm">详情</a>
                <a th:href="@{/setmeals/edit/{id}(id=${setmeal.smId})}" class="btn btn-warning btn-sm">修改</a>
                <a th:href="@{/setmeals/delete/{id}(id=${setmeal.smId})}" class="btn btn-danger btn-sm">删除</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
